const express = require('express');
const app = express();

const bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
// 端口号
const port = 3001;
//public根目录配置
app.use(express.static('public'));
//路由
const routes = require("./router/index.js");
app.use(routes);

app.get('/test', (req, res) => {
  res.send({
    code:"0",
    msg:"操作成功"
  });
});
// const {name,name1}=require("./src/test.js")
// console.log(name);
app.listen(port, () => {
  console.log(`服务启动成功`);
});
